package cn.kgc.tangcco.session;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * @author 李昊哲
 * @Description
 * @create 2020/10/19 下午3:26
 */
@WebServlet(urlPatterns = "/session03")
public class Session03 extends HttpServlet {

    private static final long serialVersionUID = -6053800021545039736L;

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        HttpSession session = request.getSession();
        System.out.println("session02_id >>> "+session.getId());
        System.out.println("slogan >>> " + request.getSession().getAttribute("slogan"));
    }
}
